#!/bin/bash

workdir=$(dirname "$0")
cd /Volumes/Coding/openeuler-kernel
mkdir -p .vscode

git checkout OLK-6.6
git pull
# -mindepth 1 to exclude the current directory "."
# cut -c 2- to remove the leading dot in "./"
# grep -v .git to exclude the .git directory
find . -mindepth 1 | cut -c 2- | grep -v .git > .vscode/filelist-olk-6.6.txt

git checkout OLK-5.10
git pull
find . -mindepth 1 | cut -c 2- | grep -v .git > .vscode/filelist-olk-5.10.txt

git checkout openEuler-1.0-LTS
git pull
find . -mindepth 1 | cut -c 2- | grep -v .git > .vscode/filelist-olk-4.19.txt

cd $workdir
cat /Volumes/Coding/openeuler-kernel/.vscode/filelist-* | grep -v .vscode | sort -u > filelist.log
